﻿using System;
using System.Collections.Generic;
using T0yK4T.IO;

namespace ToyChat
{
    /// <summary>
    /// Common interface used to describe a user
    /// </summary>
    public interface IUser
    {
        /// <summary>
        /// Forcibly Disconnects this user
        /// </summary>
        void Disconnect();

        /// <summary>
        /// Sends the specified <see cref="Packet"/> to this user
        /// </summary>
        /// <param name="packet"></param>
        void Send(Packet packet);

        /// <summary>
        /// Gets or Sets the nick name of this user
        /// </summary>
        string Nick { get; set; }

        /// <summary>
        /// Gets the ID of this user
        /// </summary>
        int UserID { get; }

        /// <summary>
        /// Gets the list of channels this user is currently in
        /// </summary>
        IEnumerable<IChannel> Channels { get; }

        /// <summary>
        /// Event used for when a user disconnects remotely
        /// </summary>
        event UserDisconnected Disconnected;

        /// <summary>
        /// Gets the username of the user
        /// </summary>
        string Username { get; }

        /// <summary>
        /// Gets the <see cref="PermissionFlags"/> associated with this user
        /// </summary>
        PermissionFlags Permissions { get; }

        /// <summary>
        /// Gets or Sets the <see cref="IUserInfo"/> object associated with this instance
        /// </summary>
        IUserInfo Info { get; set; }
    }
}
